//
//  YDMessageViewController.m
//  IngCard
//
//  Created by kf on 2017/6/2.
//  Copyright © 2017年 IngDan. All rights reserved.
//

#import "YDMessageViewController.h"
#import "YDBaseTableViewCell.h"
#import "YDBaseCustomView.h"
#import "YDCardMessageTableViewCell.h"
#import "YDCustomToastAnimator.h"
#import "YDCustomToastContentView.h"
#import "YDPeripheralsViewController.h"
#import "YDBTMessageManager.h"
#import "YDUserGuideViewController.h"
#import "YDSystemMessageTableViewCell.h"
#import "YDReportMessageTableViewCell.h"

#define HeaderSize CGSizeMake(50, 50)
typedef enum : NSUInteger {
    kSectionNewFriends = 0,
    kSectionTimeLine,
} SectionEnum;

@interface YDMessageViewController ()<QMUISearchControllerDelegate>
@property (nonatomic, strong) QMUISearchController *mySearchController;
@property(nonatomic, strong) NSMutableArray *sections;
@property(nonatomic, strong) NSMutableArray<NSString *> *sectionTitles;
@property(nonatomic, strong) QMUITips *tips;
@property(nonatomic, strong) YDBTMessageManager *messageManager;

@end

@implementation YDMessageViewController

- (void) viewDidLoad
{
    [super viewDidLoad];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    [THEME renderNavigationBar:self style:YDNavigationStyle_Red];

//    QMUINavigationButton barButtonItemWithImage:<#(UIImage *)#> position:<#(QMUINavigationButtonPosition)#> target:<#(id)#> action:<#(SEL)#>
    
//    self.navigationItem.leftBarButtonItem = UIBarButtonItem
}

- (void) initDataSource
{
    [self.dataSource addDataSource:[YDReportMessageCellDataSource class]
                         atSection:0
                            config:^(YDReportMessageCellDataSource *dataSource)
    {
        dataSource.title = @"拜访记录";
        dataSource.subTitle = @"你今天拜访了3位联系人";
        dataSource.titleImage = UIImageMake(@"message_report");
        dataSource.headerImage1 = UIImageMake(@"message_defaultHeader");
        
        dataSource.headerImage2 = UIImageMake(@"message_defaultHeader");
        
//        dataSource.headerImage1 = UIImageMake(@"message_defaultHeader");
    }];
    
    [self.dataSource addDataSource:[YDSystemMessageCellDataSource class]
                         atSection:0
                            config:^(YDSystemMessageCellDataSource *dataSource)
     {
         dataSource.title = @"系统通知";
         dataSource.subTitle = @"恭喜您的卡片已经激活";
         
         dataSource.titleImage = UIImageMake(@"message_system");
     }];
    
    [self.dataSource addDataSource:[YDCardMessageCellDataSource class]
                         atSection:0
                            config:^(YDCardMessageCellDataSource *dataSource)
     {
         dataSource.title = @"卡片动态";
         dataSource.subTitle = @"截止昨天12:20获得了32份新的名片联系人。";
         dataSource.titleImage = UIImageMake(@"message_card");
         dataSource.showLine = NO;
     }];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}

@end



